home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Programming / MuManual / Include / mmu / mmutags.h < prev    next >
C/C++ Source or Header  |  2000-04-02  |  7KB  |  182 lines

  1. /*************************************************************************
  2.  ** mmu.library                                                         **
  3.  **                                                                     **
  4.  ** a system library for arbitration and control of the MC68K MMUs      **
  5.  **                                                                     **
  6.  ** © 1999 THOR-Software, Thomas Richter                                **
  7.  ** No commercial use, reassembly, modification without prior, written  **
  8.  ** permission of the authors.                                          **
  9.  ** Including this library in any commercial software REQUIRES a        **
  10.  ** written permission and the payment of a small fee.                  **
  11.  **                                                                     **
  12.  **---------------------------------------------------------------------**
  13.  ** Definition of tags for the MMU library                              **
  14.  **                                                                     **
  15.  ** $VER: 42.00 (11.03.2000)                                            **
  16.  *************************************************************************/
  17.  
  18. #ifndef MMU_MMUTAGS_H
  19. #define MMU_MMUTAGS_H
  20.  
  21. #ifndef UTILITY_TAGITEM_H
  22. #include "utility/tagitem.h"
  23. #endif
  24.  
  25. #define MAPTAG_DUMMY            ( TAG_USER + 0x03e00000 )
  26.  
  27. /* SetProperties and SetPageProperties tags */
  28.  
  29. #define MAPTAG_DESTINATION      ( MAPTAG_DUMMY + 1 )
  30. /* destination in case the memory gets remapped */
  31.  
  32. #define MAPTAG_BLOCKID          ( MAPTAG_DUMMY + 2 )
  33. /* a unique block ID for swapped out pages. MUST be given. */
  34.  
  35. #define MAPTAG_USERDATA         ( MAPTAG_DUMMY + 3 )
  36. /* user data for invalid, non-repairable pages. Optional. */
  37.  
  38. #define MAPTAG_DESCRIPTOR       ( MAPTAG_DUMMY + 4 )
  39. /* the real descriptor for indirect pages. */
  40.  
  41.  
  42.  
  43.  
  44. /* CreateMMUContext tags */
  45.  
  46. #define MCXTAG_DUMMY            ( TAG_USER + 0x03e00100 )
  47.  
  48. #define MCXTAG_COPY             ( MCXTAG_DUMMY + 0x001 )
  49. /* copy the definition from another context, given as tag argument */
  50.  
  51. #define MCXTAG_EXECBASE         ( MCXTAG_DUMMY + 0x010 )
  52. /* disable the special AbsExecBase and low-memory handling ? */
  53.  
  54. #define MCXTAG_BLANKFILL        ( MCXTAG_DUMMY + 0x011 )
  55. /* a LONG value to fill "blank" memory with */
  56.  
  57. #define MCXTAG_MEMORYATTRS      ( MCXTAG_DUMMY + 0x012 )
  58. /* the memory attributes to allocate the MMU tables from,
  59.    defaults to MEMF_PUBLIC */
  60.  
  61. #define MCXTAG_PRIVATESUPER     ( MCXTAG_DUMMY + 0x013 )
  62. /* Create a private supervisor MMU table as well?
  63.    This defaults to FALSE, but even if the argument is
  64.    set to FALSE explicitly, the library might ignore your
  65.    choice and build a supervisor table if your table layout
  66.    is incompatible to the default supervior table. */
  67.  
  68. #define MCXTAG_ZEROBASE         ( MCXTAG_DUMMY + 0x014 )
  69. /* If the zeropage is invalidated, read the data from where?
  70.    This must be set explicitly if the zero page gets remapped,
  71.    unfortunately. Might be fixed in a future release. */
  72.  
  73. #define MCXTAG_DISCACHEDES      ( MCXTAG_DUMMY + 0x015)
  74. /* Mark the memory allocated allocated for the descriptors of THIS
  75.    context as cacheinhibit.
  76.    Defaults to FALSE. */
  77.  
  78. #define MCXTAG_LOWMEMORYLIMIT   ( MCXTAG_DUMMY + 0x016 )
  79. /* Define a boundary in the zero page such that accesses to
  80.    addresses higher than this boundary will be emulated in
  81.    software. This is mainly for 68060/68040 support under Os
  82.    V37 and V38 where chip memory started at 0x400 inside the
  83.    zero page. (NEW for V42) */
  84.  
  85.  
  86. #define MCXTAG_DEPTH            ( MCXTAG_DUMMY + 0x020 )
  87. /* define the depth of the MMU tree to build. Defaults to the
  88.    depth of the default tree, which is *usually* three.
  89.    Ranges from 1 to 4 */
  90.  
  91. #define MCXTAG_LEVELABITS       ( MCXTAG_DUMMY + 0x021 )
  92. /* number of bits to reserve for the top level of the tree */
  93.  
  94. #define MCXTAG_LEVELBBITS       ( MCXTAG_DUMMY + 0x022 )
  95. /* number of bits for the level B of the tree, if the depth is >1 */
  96.  
  97. #define MCXTAG_LEVELCBITS       ( MCXTAG_DUMMY + 0x023 )
  98. /* number of bits for the level C of the tree, if the depth is >2 */
  99.  
  100. #define MCXTAG_LEVELDBITS       ( MCXTAG_DUMMY + 0x024 )
  101. /* bits for the level D of the tree, if the depth is 4 */
  102.  
  103. #define MCXTAG_PAGEBITS         ( MCXTAG_DUMMY + 0x025 )
  104. /* the number of bits used for the page, 2^bits is the page size */
  105.  
  106. #define MCXTAG_ERRORCODE        ( MCXTAG_DUMMY + 0x030 )
  107. /* a pointer to a ULONG, to fill in an error code from CreateContext */
  108.  
  109.  
  110.  
  111.  
  112. /* AddContextHook tags */
  113.  
  114. #define MADTAG_DUMMY            ( TAG_USER + 0x03e00200 )
  115.  
  116. #define MADTAG_CONTEXT          ( MADTAG_DUMMY + 0 )
  117. /* the context to which the context hook should be added. */
  118.  
  119. #define MADTAG_TASK             ( MADTAG_DUMMY + 1 )
  120. /* if the exception is task specific, then this is the task pointer.
  121.    Note that many task specific handlers slow down exception handling. */
  122.  
  123. #define MADTAG_TYPE             ( MADTAG_DUMMY + 2 )
  124. /* type of the exception, MMUEH_SEGFAULT, MMUEH_SWAPPED, MMUEH_SWITCH or
  125.    MMUEH_LAUNCH. See exceptions.h */
  126.  
  127. #define MADTAG_CODE             ( MADTAG_DUMMY + 3 )
  128. /* the code to be called on exceptions. Should be assembly. 
  129.    a0 is the struct ExceptionData *, a1 and a4 are pointers to the data
  130.    item, see below, a5 is the pointer to the code and a6 is the MMUBase.
  131.    d0-d1/a0-a1 and a4-a5 are scratch registers. The exception handler must
  132.    return with the Z flag set (i.e. an "equal" condition) and d0 cleared to
  133.    indicate that it handled the exception and no other handler should be
  134.    called. */
  135.  
  136. #define MADTAG_DATA             ( MADTAG_DUMMY + 4 )
  137. /* data to be loaded for the exception handler, will be passed in a1 
  138.    and a4 */
  139.  
  140. #define MADTAG_NAME             ( MADTAG_DUMMY + 5 )
  141. /* a unique name for the handler. The library makes currently no use of
  142.    this name. */
  143.  
  144. #define MADTAG_PRI              ( MADTAG_DUMMY + 6 )
  145. /* the priority of the handler. Higher priority handlers are called first.
  146.    Should be above 32 for "emergency stack swap in" handlers, between 32
  147.    and -32 for standard handlers and below -32 for debugging tools like the
  148.    Enforcer and similar. */
  149.  
  150.  
  151.  
  152. /* AddMessageHook tags */
  153.  
  154. #define MADTAG_CATCHERPORT      ( MADTAG_DUMMY + 0x100 )
  155. /* the port to send the exception message to for message hook types. */
  156.  
  157.  
  158.  
  159. /* GetContextData tags */
  160.  
  161. #define MGXTAG_DUMMY            ( TAG_USER + 0x03e00400 )
  162.  
  163. #define MGXTAG_PAGESIZE         ( MGXTAG_DUMMY + 0 )
  164. /* Identical to GetPageSize() (GET only) */
  165.  
  166. #define MGXTAG_REMAPSIZE        ( MGXTAG_DUMMY + 1 )
  167. /* Identical to RemapSize() (GET only) */
  168.  
  169. #define MGXTAG_ROOT             ( MGXTAG_DUMMY + 2 )
  170. /* Address of the MMU tree root. You usually do not need it (GET only). */
  171.  
  172. #define MGXTAG_CONFIG           ( MGXTAG_DUMMY + 3 )
  173. /* Return a pointer to struct MMUConfig (GET only). */
  174.  
  175. #define MGXTAG_USERDATA         ( MGXTAG_DUMMY + $100 )
  176. /* Return the user data (GET and SET). */
  177.  
  178. #define MGXTAG_ADDRESSSPACE     ( MGXTAG_DUMMY + $101 )
  179. /* Return the address space. Reserved for the memory lib (GET and SET). */
  180.  
  181. #endif
  182.